﻿using Unity.Entities;
using Unity.Transforms;
using UnityEngine;

using Unity.Mathematics;

namespace Tank
{
    public class GameLaucher : MonoBehaviour
    {
#pragma warning disable CS0649
        [SerializeField] private CharacterSpawner characterSpawner;
#pragma warning restore CS0649

        private void Start()
        {
            InitializeGame();
        }

        private void OnDestroy()
        {
            UninitializeGame();
        }

        private void InitializeGame()
        {
            GlobalContext.Initialize();

            // character spawner initialization
            characterSpawner.Initialize();
        }

        private void UninitializeGame()
        {
            GlobalContext.UnInitialize();

            // character spawner uninitialization
            characterSpawner.Uninitialize();
        }
    }
}
